//组件
import ArrowRight from '@/components/SvgIcons/ArrowRight'
import arrowRightMoreIcon from '@/components/SvgIcons/arrowRightMoreIcon'
import CaretDown from '@/components/SvgIcons/CaretDown'
import CaretLeft from '@/components/SvgIcons/CaretLeft'
import CaretRight from '@/components/SvgIcons/CaretRight'
import CaretUp from '@/components/SvgIcons/CaretUp'
import DeleteIcon from '@/components/SvgIcons/DeleteIcon'
import FileIcon from '@/components/SvgIcons/FileIcon'
import FolderIcon from '@/components/SvgIcons/FolderIcon'
import FolderIcon2 from '@/components/SvgIcons/FolderIcon2'
import FolderIcon3 from '@/components/SvgIcons/FolderIcon3'
import SvgClose from '@/components/SvgIcons/SvgClose'
import EleadButton from '@/components/eleadButton/Button'
import EleadIcon from '@/components/eleadIcon/Icon'
import BaseDrawer from '@/components/BaseDrawer/BaseDrawer'
import BaseTree from '@/components/BaseTree/BaseTree'
import DeptPicker from '@/components/DeptPicker/DeptPicker'
import DrawerPicker from '@/components/DrawerPicker/DrawerPicker'
import MemberPicker from '@/components/MemberPicker/MemberPicker'
import RolePicker from '@/components/RolePicker/RolePicker'
import PickerInput from '@/components/PickerInput/PickerInput'
import TopBar from '@/components/layout/TopBar'
import Tags from '@/components/layout/Tags'
import NavMenu from '@/components/layout/NavMenu'
import SmartAvatar from '@/components/SmartAvatar/SmartAvatar'
import UserBar from '@/components/layout/UserBar'
import IframeView from '@/components/layout/IframeView'
import LayoutIndex from '@/components/layout/LayoutIndex'
import Page403 from '@/components/layout/other/403'
import Page404 from '@/components/layout/other/404'
import PageEmpty from '@/components/layout/other/empty'
import STable from '@/components/Table/index.vue'
import SplitLayout from '@/components/SplitLayout/SplitLayout'
import SlideBtn from '@/components/SlideBtn/SlideBtn'
import FilePreview from '@/components/FilePreview/FilePreview'
import SearchForm from '@/components/SearchForm/SearchForm'
//页面
import authLoginCodeCallback from '@/pagesDefault/auth/codeCallback'
import sysResourceSpaIndex from '@/pagesDefault/sys/resource/spa'
import sysResourceMenuIndex from '@/pagesDefault/sys/resource/menu'
import sysResourceModuleIndex from '@/pagesDefault/sys/resource/module'
import genIndex from '@/pagesDefault/gen'
import genBasic from '@/pagesDefault/gen/basic'
import genConfig from '@/pagesDefault/gen/config'
import genPreview from '@/pagesDefault/gen/preview'
import genSteps from '@/pagesDefault/gen/steps'
import devLogOplogIndex from '@/pagesDefault/dev/log/oplog'
import visLogPieChart from '@/pagesDefault/dev/log/vislog/pieChart'
import visLogLineChart from '@/pagesDefault/dev/log/vislog/lineChart'
import oplogColumnChart from '@/pagesDefault/dev/log/vislog/lineChart'
import oplogPieChart from '@/pagesDefault/dev/log/vislog/pieChart'
import vislogDetail from '@/pagesDefault/dev/log/vislog/detail'
import oplogDetail from '@/pagesDefault/dev/log/oplog/detail'
import devLogVislogIndex from '@/pagesDefault/dev/log/vislog'
import devConfigIndex from '@/pagesDefault/dev/config'
import devDictIndex from '@/pagesDefault/dev/dict'
import sysOrgIndex from '@/pagesDefault/sys/org'
import sysUserIndex from '@/pagesDefault/sys/user'
import sysUserUserCenter from '@/pagesDefault/sys/user/userCenter'
import sysPositionIndex from '@/pagesDefault/sys/position'
import sysRoleIndex from '@/pagesDefault/sys/role'
import devFileIndex from '@/pagesDefault/dev/file'
import devEmailIndex from '@/pagesDefault/dev/email'
//系统组件
import menuTreeSelect from '@/comDefault/TreeSelect/menuTreeSelect'
import IconSelector from '@/comDefault/Selector/iconSelector'
import orgSelectorPlus from '@/comDefault/Selector/orgSelectorPlus'
import posSelectorPlus from '@/comDefault/Selector/posSelectorPlus'
import roleSelectorPlus from '@/comDefault/Selector/roleSelectorPlus'
import userComplete from '@/comDefault/Selector/userComplete'
import userSelectorPlus from '@/comDefault/Selector/userSelectorPlus'
import CButton from '@/comDefault/CButton/index'
import SelectDict from '@/comDefault/Dict/SelectDict'
import MemberSearchPicker from '@/comDefault/MemberSearchPicker/MemberSearchPicker'
import GUser from '@/comDefault/GUser/GUser'
import GPos from '@/comDefault/GPos/GPos'
import GDept from '@/comDefault/GDept/GDept'
import GRole from '@/comDefault/GRole/GRole'
import FileUpload from '@/comDefault/FileUpload/FileUpload'
//工具
import type { App } from 'vue'
import * as util from '@/utils/util'
import useCommon from '@/utils/useCommon'
import downloadFile from '@/utils/downloadFile'
import * as other from '@/utils/other'
import { panesValues, replaceTag } from '@/utils/other'
import * as sso from '@/utils/sso'
import * as permission from '@/utils/permission'
import { hasPerm } from '@/utils/permission'
import * as color from '@/utils/color'
import * as themeUtil from '@/utils/themeUtil'
import * as errorHandler from '@/utils/errorHandler'
import * as formRules from '@/utils/formRules'
import { required, rules } from '@/utils/formRules'
import * as Print from '@/utils/print'
import * as request from '@/utils/request'
import { baseRequest, appRequest } from '@/utils/request'
import * as requestValid from '@/utils/requestValid'
import * as smCrypto from '@/utils/smCrypto'
import * as watermark from '@/utils/watermark'
import * as scrollBehavior from '@/routerUtil/scrollBehavior'
import * as sysRouter from '@/routerUtil/systemRouter'
import * as whiteListRouters from '@/routerUtil/whiteList'
import * as iconSelect from '@/utils/iconSelect'
import * as iconsJs from '@/utils/icons'
import * as snowy from '@/utils/snowy'
//如果没有子菜单 组件命名 :
// 浏览器路径 : /dev/vislog -> 组件路径 /dev/vislog -> devVislogIndex
//如果有子菜单 组件命名 :
// 浏览器路径 : /dev/vislog -> 组件路径 dev/log/vislog/index -> devLogVislogIndex
import '@/utils/objects'
import ModuleMenu from '@/components/layout/ModuleMenu'
import * as useTabs from '@/utils/useTabs'
import { installLibMethods, libFlowPackageMethods } from '@/utils/exportInstallMethods'
import { toCamelCaseWithDelimiter, setCache, getCache, removeCache } from '@/utils/util'
//components 必须声明键的类型 , 不然 下面在引用 components[componentName] 的时候 , 会报错
export const components: { [key: string]: any } = {
	sysResourceModuleIndex,
	sysResourceMenuIndex,
	authLoginCodeCallback,
	sysResourceSpaIndex,
	genIndex,
	genBasic,
	genConfig,
	genPreview,
	genSteps,
	devDictIndex,
	devConfigIndex,
	devLogVislogIndex,
	devLogOplogIndex,
	vislogDetail,
	visLogPieChart,
	visLogLineChart,
	oplogColumnChart,
	oplogPieChart,
	oplogDetail,
	sysOrgIndex,
	sysUserIndex,
	sysUserUserCenter,
	sysPositionIndex,
	devFileIndex,
	devEmailIndex,
	sysRoleIndex,
	iconSelector: IconSelector,
	menuTreeSelect,
	orgSelectorPlus,
	posSelectorPlus,
	roleSelectorPlus,
	userComplete,
	userSelectorPlus,
	CButton,
	SelectDict,
	MemberSearchPicker,
	GUser,
	GPos,
	GDept,
	GRole,
	FileUpload,
	Page403,
	Page404,
	PageEmpty,
	PickerInput,
	EleadButton,
	EleadIcon,
	BaseDrawer,
	BaseTree,
	DeptPicker,
	DrawerPicker,
	MemberPicker,
	RolePicker,
	SvgClose,
	ArrowRight,
	arrowRightMoreIcon,
	CaretDown,
	CaretLeft,
	CaretRight,
	CaretUp,
	DeleteIcon,
	FileIcon,
	FolderIcon,
	FolderIcon2,
	FolderIcon3,
	TopBar,
	Tags,
	NavMenu,
	SmartAvatar,
	UserBar,
	IframeView,
	LayoutIndex,
	ModuleMenu,
	STable,
	SplitLayout,
	SlideBtn,
	FilePreview,
	SearchForm
}
const install = (app: App, options = {}) => {
	//组件注册
	Object.keys(components).forEach((componentName: string) => {
		app.component(componentName, components[componentName])
	})
	//注册util函数库
	app.config.globalProperties.$util = util
}
export {
	SearchForm,
	useCommon,
	downloadFile,
	panesValues,
	replaceTag,
	hasPerm,
	sysResourceModuleIndex,
	sysResourceMenuIndex,
	authLoginCodeCallback,
	sysResourceSpaIndex,
	genIndex,
	genBasic,
	genConfig,
	genPreview,
	genSteps,
	setCache,
	getCache,
	removeCache,
	IconSelector,
	menuTreeSelect,
	orgSelectorPlus,
	posSelectorPlus,
	roleSelectorPlus,
	userComplete,
	userSelectorPlus,
	CButton,
	SelectDict,
	MemberSearchPicker,
	GUser,
	GPos,
	GDept,
	GRole,
	FileUpload,
	devDictIndex,
	devConfigIndex,
	devLogVislogIndex,
	vislogDetail,
	visLogPieChart,
	visLogLineChart,
	oplogColumnChart,
	oplogPieChart,
	oplogDetail,
	devLogOplogIndex,
	sysOrgIndex,
	sysUserIndex,
	sysUserUserCenter,
	sysPositionIndex,
	devFileIndex,
	devEmailIndex,
	sysRoleIndex,
	Page403,
	Page404,
	PageEmpty,
	PickerInput,
	EleadButton,
	EleadIcon,
	BaseDrawer,
	BaseTree,
	DeptPicker,
	DrawerPicker,
	MemberPicker,
	RolePicker,
	SvgClose,
	ArrowRight,
	arrowRightMoreIcon,
	CaretDown,
	CaretLeft,
	CaretRight,
	CaretUp,
	DeleteIcon,
	FileIcon,
	FolderIcon,
	FolderIcon2,
	FolderIcon3,
	TopBar,
	Tags,
	NavMenu,
	SmartAvatar,
	UserBar,
	IframeView,
	LayoutIndex,
	ModuleMenu,
	STable,
	SplitLayout,
	SlideBtn,
	FilePreview,
	toCamelCaseWithDelimiter,
	rules,
	sso,
	other,
	util,
	libFlowPackageMethods,
	installLibMethods,
	scrollBehavior,
	sysRouter,
	whiteListRouters,
	iconSelect,
	color,
	themeUtil,
	errorHandler,
	formRules,
	required,
	permission,
	request,
	requestValid,
	smCrypto,
	useTabs,
	watermark,
	iconsJs,
	Print,
	baseRequest,
	appRequest,
	snowy
}
//这个需要default导出
//主项目全局注册后会调用install import eleadComponentsV3 from 'elead-components-v3'
//app.use(eleadComponentsV3)
export default {
	install
}
